import java.io.FileNotFoundException;
import java.io.PrintStream;
public class ChangeSream {
	public static void main(String[] args) {
		try{
			PrintStream out = System.out;
			PrintStream cout = new PrintStream("test.txt");
			System.setOut(cout);
			System.out.println("I am chen v!");
			System.setOut(out);
			System.out.println("Hello!");
		}catch(FileNotFoundException e){
			//e.printStackTrace();
		}
		
	}
}